From d04758a98a4235116f81bf8b52c5a300b4202669 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Fri, 14 Feb 2014 03:09:00 +0000 Subject: [PATCH] fix a leak when using shortnames and no output. --- gpsbabel/waypt.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gpsbabel/waypt.cc b/gpsbabel/waypt.cc index 3abaceb04..27385e3e0 100644 --- a/gpsbabel/waypt.cc +++ b/gpsbabel/waypt.cc @@ -180,15 +180,11 @@ waypt_disp(const Waypoint* wpt) #else if (wpt->description) { #endif - char* tmpdesc = xstrdup(wpt->description); printf("%s/%s", global_opts.synthesize_shortnames ? - mkshort(mkshort_handle, tmpdesc) : - CSTRc(wpt->shortname), - tmpdesc); - if (tmpdesc) { - xfree(tmpdesc); - } + qPrintable(mkshort(mkshort_handle, wpt->description)) : + qPrintable(wpt->shortname), + qPrintable(wpt->description)); } if (wpt->altitude != unknown_alt) { -- 2.30.2